<route lang="json5">
{
  style: {
    navigationBarTitleText: '产品详情',
    navigationBarBackgroundColor: '#FFFFFF',
  },
}
</route>

<template>
  <navbar backPath="/pages-sub/login/index" text="心康用户注册协议" />
  <view class="view-report">
    <web-view :src="url"></web-view>
  </view>
</template>

<script lang="js" setup>
import { showModal } from '@/utils/publicMethods'
const url = ref('')

onLoad(async (option) => {
  if (!option?.id) {
    await showModal({ title: '查询参数id异常' })
    return uni.navigateBack()
  }
  url.value = decodeURIComponent(option.id)
  // -------------------微信分享----------------------
  // 分享至好友/群聊
  onShareAppMessage((res) => {
    return {
      title: '产品详情',
      path: `/pages-sub/advertisement/index?id=${encodeURIComponent(url.value)}`,
      success: (res) => {},
      fail: (res) => {},
    }
  })
  // 分享到朋友圈
  onShareTimeline((res) => {
    return {
      title: '产品详情',
      path: `/pages-sub/advertisement/index?id=${encodeURIComponent(url.value)}`,
      success: (res) => {},
      fail: (res) => {},
    }
  })
})
</script>

<style lang="scss" scoped></style>
